package com.naiterui.ehp.bs.emr.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.naiterui.ehp.bp.support.security.InterceptorAddition;
import com.naiterui.ehp.bs.emr.interceptor.LoginInterceptor;
import com.naiterui.ehp.bs.emr.remote.IEmrRemoter;

import lombok.extern.slf4j.Slf4j;

/**
 * @author guoyongxiang
 */
@Slf4j
@Configuration
public class EmrInterceptorConfig {

    @Autowired
    private IEmrRemoter remoter;

    @Bean
    public InterceptorAddition emrLoginInterceptor() {
        return InterceptorAddition.build(new LoginInterceptor(remoter)).addPathPatterns("/emr/**");
    }

}